package net.shao.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.hyphenate.chat.EMClient;
import com.hyphenate.exceptions.HyphenateException;

import net.shao.R;
import net.shao.base.BaseActivity;

import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

/**
 * Created by shao on 2016/8/23.
 */
public class RegisterActivity extends BaseActivity{

    @ViewInject(R.id.et_tel_LogReg)
    private EditText et_tel_LogReg;
    @ViewInject(R.id.et_password_LogReg)
    private EditText et_password_LogReg;
    @ViewInject(R.id.btn_UserloginReg_logreg)
    private Button btn_UserLogin;
    @ViewInject(R.id.tv_toRegistered)
    private TextView tv_toRegistered;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        x.view().inject(this);

        btn_UserLogin.setText("注册");
        tv_toRegistered.setVisibility(View.GONE);
        btn_UserLogin.setOnClickListener(v -> {
            try {
                EMClient.getInstance().createAccount(et_tel_LogReg.getText().toString(),et_password_LogReg.getText().toString());
            } catch (HyphenateException e) {
                e.printStackTrace();
            }
        });
    }
}
